<?php
require_once 'RobotServiceEx/deliver.php';
require_once 'RobotServiceEx/UserAttribute.php';
require_once 'RobotServiceEx/RobotRequest.php';
require_once 'RobotServiceEx/RobotServiceEx.php';
require 'vendor/autoload.php';

$question = "蓝屏";
$userId = "001";

$pf = new UserAttribute("platform", "web");
$attributes = array( $pf);

$robotRequest = new RobotRequest(10, $question, "", $userId);
$robotRequest->attributes = $attributes;

$deliver = new deliver($robotRequest);

$client = new nusoap_client('http://gxdw.demo.uairobot.com/robot/app/gxdw/ws/RobotServiceEx?wsdl', true);
$client->soap_defencoding = 'UTF-8';
$client->decode_utf8 = false;

$robotResponse = $client->call("deliver", array(
  $deliver
));
